﻿@using MvcAtletIS.Helpers;
@model string[]
@{
    ViewBag.Title = "Role";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@section head {

    <link href="@Url.Content("~/footable/css/footable.core.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/footable/css/footable.standalone.css")" rel="stylesheet" type="text/css" />
  
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js" type="text/javascript"></script>
    <script src="@Url.Content("~/footable/js/footable.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/footable/js/footable.sort.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/footable/js/footable.filter.js")" type="text/javascript"></script>
    
    <script type="text/javascript">
        $(function () {
            $("table").footable();
        });
    </script>
}

<h2>Role používateľa: @ViewBag.MyUser</h2>

@using (Html.BeginForm())
{   
    <p> 
        Pridať novú rolu: 
        @Html.DropDownList("AddRole", string.Empty)
        <input type="submit" value="Pridať" />
    </p>
}

<table class="footable table toggle-arrow-tiny">
    <thead>
    <tr>
        <th data-sort-ignore="true">
            Rola
        </th>
        <th width="50px" data-sort-ignore="true"></th>
    </tr>
    </thead>
    <tbody>
    @foreach (string s in Model)
    { 
        <tr>
            <td>
                @s
            </td>
            <td>
                @Html.ImageActionLink(Url.Content("~/Content/icons/delete.gif"), "", "RemoveRole", new { UserName = ViewBag.MyUser, RoleName = s }, new { title = "Zmazať", border = 0, hspace = 2 })
            </td>
        </tr>  
    }
    </tbody>
</table>